//
//  CertificationViewController.m
//  Yihubang
//
//  Created by xmy on 16/8/28.
//  Copyright © 2016年 jinghao. All rights reserved.
//

#import "IMViewController.h"
#import "AllContactVCModel.h"

@interface IMViewController ()

@property (nonatomic,strong) AllContactVCModel *viewModel;


@end

@implementation IMViewController

@synthesize viewModel = _viewModel;
//@synthesize mTableView = _mTableView;

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"所有用户";
    self.showLeftMenu = YES;
    [self.navigationController.navigationBar setHidden:NO];
    [self.viewModel bindTableView:self.mTableView];
    
//    [self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"认证" style:UIBarButtonItemStylePlain target:self action:@selector(Certification:)] animated:TRUE];

    [self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"通讯录" style:UIBarButtonItemStylePlain target:self action:@selector(MyAddress)] animated:TRUE];
    
    
//    [self.navigationItem setRightBarButtonItem:[UIBarButtonItem alloc] initWithTitle

    

}

- (void)gotoBack {
    [self.navigationController.navigationBar setHidden:YES];
    [self.navigationController popViewControllerAnimated:YES];
}

//跳转至通讯录页面
- (void)MyAddress{
//    MyAdressContractsVC *mydress = (MyAdressContractsVC*)[UIStoryboard viewController:@"Main" identifier:@"MyAdressContractsVC"];
//    
//    [self pushViewController:mydress animated:YES];
    
    UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
    UIViewController *vc = [story instantiateViewControllerWithIdentifier:@"MyAdressContractsVC"];
    
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (AllContactVCModel *)viewModel{
    if (!_viewModel) {
        _viewModel = [[AllContactVCModel alloc] initWithViewController:self];
    }
    return _viewModel;
}

//- (void)gotoBack
//{
//    
//}


#pragma mark --

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
